// File Name: ServerSideCustomProvider.h

#ifndef SERVERSIDECUSTOMPROVIDER_H
#define SERVERSIDECUSTOMPROVIDER_H

#include <UIAutomation.h>
#include <UIAutomationCore.h>
#include <UIAutomationCoreApi.h>

#include "ICustomProvider.h"
#include "CustomLookupIds.h"

namespace UIAutomationCPP
{
	public class ServerSideCustomProvider : public IRawElementProviderSimple
	{
		public:
			ServerSideCustomProvider();
			ServerSideCustomProvider(HWND);
			virtual ~ServerSideCustomProvider();
			ServerSideCustomProvider& operator = (ServerSideCustomProvider&);

			//void InitializeIDs();
			//int CustomUiaIdLookup(AutomationIdentifierType, GUID*);

			HRESULT __stdcall GetPatternProvider(PATTERNID, IUnknown**);
			HRESULT __stdcall GetPropertyValue(PROPERTYID, VARIANT*);
			HRESULT __stdcall get_HostRawElementProvider(IRawElementProviderSimple**);
			HRESULT __stdcall get_ProviderOptions(ProviderOptions*);

			/*HRESULT WINAPI UiaRaiseAutomationEvent(IRawElementProviderSimple*, EVENTID);
			HRESULT WINAPI UiaRaiseAutomationPropertyChangedEvent(IRawElementProviderSimple*, PROPERTYID, VARIANT, VARIANT);
			HRESULT WINAPI UiaRaiseStructureChangedEvent(IRawElementProviderSimple*, StructureChangeType, int*, int);*/

			HRESULT __stdcall QueryInterface(REFIID, void**);
			ULONG __stdcall AddRef();
			ULONG __stdcall Release();

		private:
			HWND controlHWnd;
			ULONG refCount;
			CustomIds Ids;
	};
}
#endif
